1. Field of the Invention
The present invention relates to a storage controller that manages data using such a physical disk as a magnetic disk and the method thereof, and more particularly to a storage controller suitable for a RAID controller and operating system and the method thereof.
2. Description of the Related Art
For storage equipment using such a storage medium as a magnetic disk, magneto-optical disk and optical disk, the format must be written to the storage medium to access the storage medium when requested by the data processing unit. There are two types of formats: a physical format such as the CKD format, and a logical format where a data area is separated in the processing unit of the host OS (e.g. in block units), and is identified.
By such formatting of the storage medium, the storage medium can be accessed (read/written) based on the host commands of the host OS. The physical format is the initialization processing of the medium in track units, and logical formatting is the format processing of the data area of the tracks, where physical formatting has been performed, in block units. Format processing takes time to format all the blocks of the medium, and in actual use of an unformatted medium, a long wait time (e.g. 30 minutes or more) for format processing is required.
To solve this problem, in prior art, the storage medium is available immediately without performing format processing as the initialization processing, and format processing on the target block is performed when a write access request is received, and then write operation is executed on the target block (e.g. Japanese Patent Application Laid-Open No. H8-147110).
In prior art, the logical formatting is executed when an access request is received, so the logical formatting is not executed when the access request is not received. This prior art is suitable when such data as music and images are continuously written to one medium, such as an MD (Mini Disk).
However, when data is accessed randomly, such as the case of a large-scale storage system connected to a host and server, both logical format processing and access processing must be executed for each access, so the time required for access processing increases, and access time becomes long.
Particularly in a large capacity storage system, the time required for logical format is several tens of minutes to several hours, depending on the size of the logical volume, so the access time increases in order to construct a new storage system and to add a logical volume to a current system.
With the foregoing in view, it is an object of the present invention to provide a storage controller for executing data processing, including host access, while executing logical format, and the control method thereof.
It is another object of the present invention to provide a storage controller for decreasing the wait time for host access when logical format is executed regardless the host access, and the control method thereof.
It is still another object of the present invention to provide a storage controller for decreasing the delay of host access by executing logical format processing related to host access and logical format processing unrelated to host access in parallel, and the control method thereof.
To achieve these objects, the present invention is a storage controller which accesses an access request area on a logical volume stored in a physical disk according to a disk access request from a host device, comprising: a logical format management module having a bit map memory for managing progress information on whether each predetermined format processing area of the logical volume has been formatted or not, and a lower layer module for actually accessing the physical disk according to the processing request from the logical format management module, wherein the logical format management module refers to the bit map memory according to the disk access request, judges whether all the access areas have been formatted, requests disk access to the lower layer module when judged as formatted. While, when not formatted, the logical format management module issues a logical format processing request before the disk access and queues the disk access request to a queue, and searches an unformatted area from the bit map memory and issues the logical format processing request for the unformatted area when there is not a disk access request in the queue.
In the present invention, logical format processing of the physical disk is performed in the background of host access, so host access can be sequentially executed while executing logical format.
Also the progress information on whether each block on the logical volume has been formatted or not is managed by bit maps, so when disk access is requested, whether all the access areas have been formatted can be judged referring to bit maps. If formatted, disk access is requested to a lower layer module, and if not formatted, a logical format processing request is issued before the disk access, and the disk access request is queued in the queue. If there is no disk access request in the queue, an unformatted area is searched from bit maps, and a logical format processing request is issued.
Therefore a disk access request can be executed while executing format processing in sequential independent to the host access, and whether the access area for which disk access is requested has been formatted or not can be easily judged, so the speed of response to the access request can be increased, even if a quick format performed in the background of the host access is executed. Returning to sequential formatting is also easy since bit maps are referred to.
Also in the present invention, it is preferable that the logical format management module updates the bit maps for managing the progress information at the completion of execution of the logical format processing request from the lower layer module. It is also preferable that the logical format management module searches the queue at the completion of execution of the logical format processing request, and issue the disk access request for which the logical format has completed, to the lower layer module.
By this, whether formatted or not can be referred to or updated by bit maps, and can be judged and updated at high-speed. Also a host access waited in a queue can be executed with priority, and host access can be executed at a higher speed.
Also in the present invention, it is preferable that the logical format management module judges competition among logical format requests to be issued, and perform link processing. By this, competition among a plurality of logical format requests according to the host access to an unformatted area and competition between a logical format request according to the host access and a sequential format request are judged, and one request is in a queue and is link-processed. Therefore, even though the logical format requests are continuously issued, the logical format requests can be organized and processed. This makes the response to host access faster.
Also in the present invention, it is preferable that the logical format management module limits the number of queues of the lower layer module in logical volume units, and the logical format processing requests, when the limit is exceeded, are temporarily held. By this, even if logical format processing requests are continuously issued, the number of queues in the lower layer is limited in redundant group or logical volume units, and format processing requests when the limit is exceeded are held temporarily, therefore a delay in format processing in redundant group or logical volume units can be prevented.
Also in the present invention, it is preferable that the logical format management module has each bit map table for the plurality of logical volumes respectively stored on the physical disk. Also it is preferable that the present invention further comprise a management table for storing the progress information of the logical format for each logical volume of each redundant group stored on the physical disk, and an upper layer module which receives a disk access request from the host, judges whether the access target logical volume has been logically formatted referring to the management table, and transfers the request processing to the logical format management module if the logical volume has not been logically formatted.
By this, as whether a logical volume has been formatted or not is managed in logical volume units and in block units with the management table and bit maps, the format processing in logical format units is possible. Therefore bit maps are not searched for a formatted logical volume, which prevents a processing delay.
Other features and advantages of the present invention will become readily apparent from the following description taken in conjunction with the accompanying description taken in conjunction with the accompanying drawings.